<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>random 获取随机数</title>
        <script type="text/javascript">
            // Math.floor(Math.random() * (max - min + 1)) + min
            function getRandom(min, max) {
                return Math.floor(Math.random() * (max - min + 1)) + min;
            }
            console.log(getRandom(1, 10));
        </script>
    </head>
    <body>
    </body>
</html>
